package cn.csc.module.pay.enums;

import cn.csc.framework.common.exception.ErrorCode;

/**
 * Pay 错误码 Core 枚举类
 *
 * pay 系统，使用 1-007-000-000 段
 */
public interface ErrorCodeConstants {

    /**
     * ========== APP 模块 1-007-000-000 ==========
     */
    ErrorCode PAY_APP_NOT_FOUND = new ErrorCode(1007000000, "App 不存在");
    ErrorCode PAY_APP_IS_DISABLE = new ErrorCode(1007000002, "App 已经被禁用");
    ErrorCode PAY_APP_EXIST_TRANSACTION_ORDER_CANT_DELETE =  new ErrorCode(1007000003, "支付应用存在交易中的订单,无法删除");
    ErrorCode HTTP_INVOKE_ERROR = new ErrorCode(1007000004, "Http请求调用异常");

    /**
     * ========== CHANNEL 模块 1-007-001-000 ==========
     */
    ErrorCode PAY_CHANNEL_NOT_FOUND = new ErrorCode(1007001000, "支付渠道的配置不存在");
    ErrorCode PAY_CHANNEL_IS_DISABLE = new ErrorCode(1007001001, "支付渠道已经禁用");
    ErrorCode PAY_CHANNEL_CLIENT_NOT_FOUND = new ErrorCode(1007001002, "支付渠道的客户端不存在");
    ErrorCode CHANNEL_NOT_EXISTS = new ErrorCode(1007001003, "支付渠道不存在");
    ErrorCode CHANNEL_EXIST_SAME_CHANNEL_ERROR = new ErrorCode(1007001005, "已存在相同的渠道");
    ErrorCode CHANNEL_WECHAT_VERSION_2_MCH_KEY_IS_NULL = new ErrorCode(1007001006,"微信渠道v2版本中商户密钥不可为空");
    ErrorCode CHANNEL_WECHAT_VERSION_3_PRIVATE_KEY_IS_NULL = new ErrorCode(1007001007,"微信渠道v3版本apiclient_key.pem不可为空");
    ErrorCode CHANNEL_WECHAT_VERSION_3_CERT_KEY_IS_NULL = new ErrorCode(1007001008,"微信渠道v3版本中apiclient_cert.pem不可为空");
    ErrorCode PAY_CHANNEL_NOTIFY_VERIFY_FAILED = new ErrorCode(1007001009, "渠道通知校验失败");

    // ========== ORDER 模块 1-007-002-000 ==========

    ErrorCode PAY_ORDER_NOT_FOUND = new ErrorCode(1007002000, "支付订单不存在");
    ErrorCode PAY_ORDER_STATUS_IS_NOT_WAITING = new ErrorCode(1007002001, "支付订单不处于待支付");
    ErrorCode PAY_ORDER_STATUS_IS_NOT_SUCCESS = new ErrorCode(1007002002, "支付订单不处于已支付");
    ErrorCode PAY_ORDER_ERROR_USER = new ErrorCode(1007002003, "支付订单用户不正确");
    ErrorCode PAY_ORDER_ERROR_SIGN = new ErrorCode(1007002004, "支付订单参数签名错误");
    ErrorCode PAY_ORDER_SUBMIT_CHANNEL_ERROR = new ErrorCode(1007002005, "发起支付报错，错误码：{}，错误提示：{}");
    ErrorCode PAY_ORDER_REFUND_FAIL_STATUS_ERROR = new ErrorCode(1007002006, "支付订单退款失败，原因：状态不是已支付或已退款");
    ErrorCode PAY_ORDER_WRONG_ARGS = new ErrorCode(1007002007, "交易状态查询请求参数({},{}) 的 appId或merchantOrderId 不正确");

    /**
     * ========== ORDER 模块(拓展单) 1-007-003-000 ==========
     */
    ErrorCode PAY_ORDER_EXTENSION_NOT_FOUND = new ErrorCode(1007003000, "支付交易拓展单不存在");
    ErrorCode PAY_ORDER_EXTENSION_STATUS_IS_NOT_WAITING = new ErrorCode(1007003001, "支付交易拓展单不处于待支付");
    ErrorCode PAY_ORDER_EXTENSION_STATUS_IS_NOT_SUCCESS = new ErrorCode(1007003002, "支付订单不处于已支付");
    ErrorCode PAY_ORDER_INVALID_TRADE_NO = new ErrorCode(1007003003, "无效的交易订单号");

    // ========== 支付模块(退款) 1-007-006-000 ==========
    ErrorCode PAY_REFUND_AMOUNT_EXCEED = new ErrorCode(1007006000, "退款金额超过订单可退款金额");
    ErrorCode PAY_REFUND_ALL_REFUNDED = new ErrorCode(1007006001, "订单已经全额退款");
    ErrorCode PAY_REFUND_CHN_ORDER_NO_IS_NULL = new ErrorCode(1007006002, "该订单的渠道订单为空");
    ErrorCode PAY_REFUND_SUCCEED = new ErrorCode(1007006003, "已经退款成功");
    ErrorCode PAY_REFUND_NOT_FOUND = new ErrorCode(1007006004, "支付退款单不存在");
    ErrorCode PAY_REFUND_HAVE = new ErrorCode(1007006005, "已经有退款在处理中");
    ErrorCode REFUND_STATUS_IS_NOT_WAITING = new ErrorCode(1_007_006_006, "支付退款单不处于待退款");



    /**
     * ========== 支付商户信息 1-007-004-000 ==========
     */
    ErrorCode PAY_MERCHANT_NOT_EXISTS = new ErrorCode(1007004000, "支付商户信息不存在");
    ErrorCode PAY_MERCHANT_EXIST_APP_CANT_DELETE = new ErrorCode(1007004001, "支付商户存在支付应用,无法删除");

    /**
     * ========== 资金账户绑定的银行卡信息 1-007-007-000 ==========
     */
    ErrorCode BANK_NOT_EXISTS = new ErrorCode(1007007000, "资金账户绑定的银行卡不存在");

    /**
     * ========== 见证宝资金账户身份认证信息 1-007-008-000 ==========
     */
    ErrorCode CARD_NOT_EXISTS = new ErrorCode(1007008000, "见证宝资金账户身份认证不存在");
    ErrorCode CARD_COMPANY_NOT_EXISTS = new ErrorCode(1007008001, "见证宝资金账户公司认证不存在");
    ErrorCode CARD_COMPANY_NOT_NAME= new ErrorCode(1007008002, "企业名称不匹配");
    ErrorCode CARD_COMPANY_NOT_PHONE= new ErrorCode(1007008003, "开户手机不匹配");
    ErrorCode CARD_COMPANY_NOT_MEMBERNUM= new ErrorCode(1007008004, "证件号查询信息为空");

    /**
     * ========== 提款申请记录 1-007-009-000 ==========
     */
    ErrorCode DRAW_CASH_NOT_EXISTS = new ErrorCode(1007009000, "提款申请记录不存在");
    ErrorCode DRAW_CASH_COMPANY_NOT_EXISTS = new ErrorCode(1007009001, "提款申请记录表（对公）不存在");
    ErrorCode DRAW_CASH_JZB_EXITSTS = new ErrorCode(1007009002, "见证宝提现失败");


    /**
     * ========== 用户资金 1-007-010-000 ==========
     */
    ErrorCode FUND_NOT_EXISTS = new ErrorCode(1007010000, "用户资金不存在");
    ErrorCode FUND_COMPANY_NOT_EXISTS = new ErrorCode(1007010001, "用户资金表(公司)不存在");

    /**
     * ========== 用户资金 1-007-011-000 ==========
     */
    ErrorCode FUND_DETAILS_NOT_EXISTS = new ErrorCode(1007011000, "用户资金收支明细表不存在");
    ErrorCode FUND_DETAILS_COMPANY_NOT_EXISTS = new ErrorCode(1007011001, "用户资金收支明细表（公司）不存在");

    ErrorCode JZB_ORDER_NOT_EXISTS = new ErrorCode(1007012000, "见证宝订单表不存在");
    ErrorCode JZB_ORDER_NOT_DATA_EXISTS = new ErrorCode(1007012001, "见证宝订单不存在");

    ErrorCode JZB_ORDER_ERRLOG_NOT_EXISTS = new ErrorCode(1007013000, "见证宝订单表错误日志不存在");

    ErrorCode FUND_DETAILS_LOG_NOT_EXISTS = new ErrorCode(1007014000, "用户资金收支明细表记录不存在");

    /**
     * =======================见证宝分账 1-007-015-000============================
     */
    ErrorCode DRIVID_REFUND_FAIL_NOT_MATCH = new ErrorCode(1007015000, "资金未冻结,不能分账");

    /**
     * =======================见证宝提现费率 1-007-016-000============================
     */
    ErrorCode JZB_RATE_NOT_EXISTS = new ErrorCode(1007016000, "见证宝提现手续费率不存在");

    ErrorCode FUND_DETAILS_INFO_NOT_EXISTS = new ErrorCode(1007017000, "用户资金提现分账明细不存在");

    /**
     * =======================见证宝api相关 1-007-018-000============================
     */
    ErrorCode BIND_SMALL_AMOUNT_WITH_CHECK_CORP_ERR = new ErrorCode(1007018000, "会员绑定提现账户小额鉴权异常");
    ErrorCode CHECK_AMOUNT_WITH_CORP_PARAMS_ERR = new ErrorCode(1007018001, "会员绑定提现账户-小额鉴权回填金额参数传入异常");
    ErrorCode CHECK_AMOUNT_WITH_CORP_JZB_ERR = new ErrorCode(1007018002, "会员绑定提现账户-小额鉴权回填金额异常");
    ErrorCode SMALL_AMOUNT_TRANSFER_QUERY_ERR = new ErrorCode(1007018003, "查询小额鉴权转账结果异常");
    ErrorCode CHECK_AMOUNT_WITH_P_PARAMS_ERR = new ErrorCode(1007018008, "会员绑定提现账户-银联鉴权回填金额参数传入异常");
    ErrorCode CHECK_AMOUNT_WITH_P_JZB_ERR = new ErrorCode(1007018009, "会员绑定提现账户-银联鉴权回填验证码异常");
    ErrorCode CHECK_AMOUNT_WITH_BIND_JZB_ERR = new ErrorCode(1007018004, "会员绑定信息查询异常");
    ErrorCode CHECK_AMOUNT_WITH_UNBIND_JZB_ERR = new ErrorCode(1007018005, "会员解绑提现账户异常");
    ErrorCode CHECK_AMOUNT_WITH_MUCH_JZB_ERR = new ErrorCode(1007018006, "会员提现余额不足");
    ErrorCode CHECK_AMOUNT_WITH_BANK_JZB_ERR = new ErrorCode(1007018007, "提现银行卡不存在或者信息错误,请先绑卡或者修改信息");
    ErrorCode BANK_WITH_DRAW_CASH_BACK_QUERY_ERR = new ErrorCode(1007018010, "查询小额鉴权转账结果(时间间隔不能大于7天)异常");
    ErrorCode BANK_CLEAR_QUERY_ERR = new ErrorCode(1007018011, "查询银行在途清算结果(时间间隔不能大于7天)异常");
    ErrorCode QUERY_CUST_ACCTID_BALANCE_ERR = new ErrorCode(1007018012, "查询会员子账号余额异常");
    ErrorCode QUERY_CUST_ACCTID_ERR = new ErrorCode(1007018013, "根据会员代码查询会员子账号异常");
    ErrorCode QUERY_CUST_ACCTID_BYTHIRDCUSTID_ERR = new ErrorCode(1007018014, "根据会员代码查询会员子账号异常");
    ErrorCode CUST_ACCTID_BALANCE_QUERY_ERR = new ErrorCode(1007018015, "查询银行子账户余额异常");
    ErrorCode SINGLE_TRANSACTION_STATUS_QUERY_ERR = new ErrorCode(1007018016, "查询银行单笔交易状态异常");
    ErrorCode SUB_ACCOUNT_QUEST_ERR = new ErrorCode(1007018017, "分账异常");
    ErrorCode AUTONYM_OPEN_CUST_ACCTID_ERR = new ErrorCode(1007018018, "会员子账户开立-调用异常");
    ErrorCode TRA_FINAL_STATUS_QUERY = new ErrorCode(1007018019, "交易终态查询-调用异常");
    ErrorCode MEMBERSHIP_WITH_DRAW_CASH_HTTP_ERR = new ErrorCode(1007018020, "会员提现HTTP请求异常");
    ErrorCode QUERY_CROWD_ACOUNT_MSG_ERR = new ErrorCode(1007018021, "订单冻结余额查询请求异常");
    ErrorCode THIRD_FREEZE_RECHARGE_ERR = new ErrorCode(1007018022, "冻结充值请求异常");
    ErrorCode THIRD_FREEZE_RECHARGE_CANCEL_ERR = new ErrorCode(1007018023, "冻结充值撤销请求异常");
    ErrorCode REFUND_NOT_ALLOW_ERR = new ErrorCode(1007018024, "当前订单状态，不允许发起退款，请联系客服管理员！");
    ErrorCode THIRD_FREEZE_RECHARGE_CANCEL_SUCCESS = new ErrorCode(1007018025, "冻结充值撤销成功");
    ErrorCode THIRD_FREEZE_RECHARGE_CANCEL_FAIL = new ErrorCode(1007018026, "冻结充值撤销失败");
    ErrorCode THIRD_FREEZE_RECHARGE_WAITING = new ErrorCode(1007018027, "订单待冻结充值，请稍后再发起退款！");



    // ========== 示例订单 1-007-900-000 ==========
    ErrorCode PAY_DEMO_ORDER_NOT_FOUND = new ErrorCode(100790000, "示例订单不存在");
    ErrorCode PAY_DEMO_ORDER_UPDATE_PAID_STATUS_NOT_UNPAID = new ErrorCode(100790001, "示例订单更新支付状态失败，订单不是【未支付】状态");
    ErrorCode PAY_DEMO_ORDER_UPDATE_PAID_FAIL_PAY_ORDER_ID_ERROR = new ErrorCode(100790002, "示例订单更新支付状态失败，支付单编号不匹配");
    ErrorCode PAY_DEMO_ORDER_UPDATE_PAID_FAIL_PAY_ORDER_STATUS_NOT_SUCCESS = new ErrorCode(100790003, "示例订单更新支付状态失败，支付单状态不是【支付成功】状态");
    ErrorCode PAY_DEMO_ORDER_UPDATE_PAID_FAIL_PAY_PRICE_NOT_MATCH = new ErrorCode(100790004, "示例订单更新支付状态失败，支付单金额不匹配");
    ErrorCode PAY_DEMO_ORDER_REFUND_FAIL_NOT_PAID = new ErrorCode(100790005, "发起退款失败，示例订单未支付");
    ErrorCode PAY_DEMO_ORDER_REFUND_FAIL_REFUNDED = new ErrorCode(100790006, "发起退款失败，示例订单已退款");
    ErrorCode PAY_DEMO_ORDER_REFUND_FAIL_REFUND_NOT_FOUND = new ErrorCode(100790007, "发起退款失败，退款订单不存在");
    ErrorCode PAY_DEMO_ORDER_REFUND_FAIL_REFUND_NOT_SUCCESS = new ErrorCode(100790008, "发起退款失败，退款订单未退款成功");
    ErrorCode PAY_DEMO_ORDER_REFUND_FAIL_REFUND_ORDER_ID_ERROR = new ErrorCode(100790008, "发起退款失败，退款单编号不匹配");
    ErrorCode PAY_DEMO_ORDER_REFUND_FAIL_REFUND_PRICE_NOT_MATCH = new ErrorCode(100790004, "发起退款失败，退款单金额不匹配");


}
